﻿using UnityEngine;
using System.Collections;

public class RangeTrigger : MonoBehaviour {
	public float triggerDistance = 10f;
	public bool isIn = false;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		if (Vector3.Distance (transform.position, StaticVarFunc.Player.transform.position) < triggerDistance) {
			BroadcastMessage ("OnPlayerStay",SendMessageOptions.DontRequireReceiver);
			isIn = true;
		} else {
			isIn = false;
		}
	}
}
